<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="mofang.css">
</head>
<body>
    <div class="wrapper">
        <div class="cube cubeFP">
            <img class="img1" src="./img/1.jpg" alt="">
            <img class="img2" src="./img/2.jpg" alt="">
            <img class="img3" src="./img/3.jpg" alt="">
            <img class="img4" src="./img/4.jpg" alt="">
            <img class="img5" src="./img/5.jpg" alt="">
            <img class="img6" src="./img/6.jpg" alt="">
        </div>
    </div>
    <h2>请随便点下面的图片按钮 反正都不会动</h2>
    <div class="img-buttons">
        <input type="image"  class="show-imge-1" src="./img/1.jpg" alt="">
        <input type="image"  class="show-imge-2" src="./img/2.jpg" alt="">
        <input type="image"  class="show-imge-3" src="./img/3.jpg" alt="">
        <input type="image"  class="show-imge-4" src="./img/4.jpg" alt="">
        <input type="image"  class="show-imge-5" src="./img/5.jpg" alt="">
        <input type="image"  class="show-imge-6" src="./img/6.jpg" alt="">
    </div>
    <script>
        
        var imgBut=document.getElementsByClassName('img-buttons')[0],
                cube=document.getElementsByClassName('cube')[0],
                cubeCN=cube.classList[1];
        imgBut.addEventListener('click',function(e){
            var targeN=e.target.nodeName,
            targeC=e.target.className;
            console.log(targeN,targeC);
           
                
        if(targeN=='INPUT'&&targeC!==cubeCN){
            cube.classList.replace(cubeCN,targeC);
            cubeCN=targeC;
            }
        })

        
    </script>
</body>
</html>